import edu.gznu.ics.fast.pulsar.model.vo.web.PicQueryResultVO;
import edu.gznu.ics.fast.pulsar.model.vo.web.QueryCommandVO;
import edu.gznu.ics.fast.pulsar.service.prestoacc.picService.PicInfoQueryService;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;
import java.util.List;
//import com.alibaba.fastjson.JSON;

//
//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = {"classpath:spring-mybatis.xml"})
//public class QuerySqltest {
//     private static Logger logger = Logger.getLogger(QuerySqltest.class);
//    //  private ApplicationContext ac = null;
//    @Resource
//     //private UserService userService = null;
//   private PicInfoQueryService picInfoQueryService=null;
//  //  @Resource
//  // private UserLoginService userLoginService=null;
//    @Test
//    public void test1() {
//             /* TdUserPO user = userService.getUserByName("liuzj");
//        TdUserVO tdUserVO=new TdUserVO();
//        tdUserVO.setUserName("liuzj");
//        tdUserVO.setUserPasswd("");
//      boolean flag=  userLoginService.checkUserLoginInfo(tdUserVO);
//                 System.out.println(user.getUserName()+flag);
//        */
//        QueryCommandVO queryCommandVO=new QueryCommandVO();
//        queryCommandVO.setSql("select t.file_id, t.file_name, p.task_id, "
//                + "p.startdt, p.enddt, p.ip, p.distrubted, p.calover "
//                + "from t_fits_info t "
//                + "left join t_task p "
//                + "on t.file_id = p.file_id "
//                + "left join ( "
//                + "select t.file_id, t.task_id from t_pic_info t group by t.file_id, t.task_id"
//                + ") q "
//                + "on p.file_id = q.file_id and p.task_id = q.task_id "
//                + "where (p.calover = 0) "
//                + "or (p.calover = 1 and q.file_id is not null) "
//                + "order by p.calover desc, p.distrubted desc");
//        List<PicQueryResultVO> picQueryResultVO;
//        // picQueryResultVO=picInfoQueryService.findPicInfoBySql(queryCommandVO, user);
//        //  logger.info(picQueryResultVO.get(0).getFileName());
//          //logger.info(JSON.toJSONString(user.getUserId()));
//    }
//}
